package com.jn.mvp.application;

import android.app.Application;

import com.jn.mvp.component.AllComponent;
import com.jn.mvp.component.DaggerAllComponent;
import com.jn.mvp.module.GsonModule;
import com.jn.mvp.module.HttpModule;

public class MyApplication extends Application {
    private AllComponent mAllComponent;
    private static MyApplication instance;

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        mAllComponent = DaggerAllComponent
                .builder()
                .httpModule(new HttpModule())
                .gsonModule(new GsonModule())
                .build();
    }

    public AllComponent getAllComponent() {
        return mAllComponent;
    }

    public static MyApplication getInstance() {
        return instance;
    }
}
